package com.zzxz.practicaltrainingsys.service;

import com.zzxz.practicaltrainingsys.entity.Team;
import com.zzxz.practicaltrainingsys.vo.ViewTeam;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;


public interface TeamService {

    //在组队信息表（team）里插入组长学号、组名、选题编号、邀请码、项目编号、小组组号。
    int insertTeam(Team team);

    //插入副组长，根据组号更新team表中的viceleader_id（副组长）字段
    int updateViceleaderId(Team team);

    //在组队信息表（team）根据组长学号查取邀请码。
    String getInviteCodeByLeaderId(Integer leader_id);

    //根据组号在组队信息表（team）插入小组分数
    int updateGroupMarks(@RequestBody Team team);

    //根据组号team_id在组队信息表（team）查询小组成绩
    String getGroupMarksByTeamId(Integer team_id);

    //组队所有信息
    List<ViewTeam> getViewTeamsPage(int offset, int pageSize);
    int getTotalCount();

    int countByTopicId(Integer topic_id);

    Map<String, Object> createTeamAndJoin(Map<String, Object> params, MemberService memberService);

    Team findByInviteCode(String invite_code);

    //判断角色
    String getUserRole(int studentId);

    int countByProjectAndTopic(Integer project_id, Integer topic_id);

    Team getTeamInfo(Integer team_id);

    //根据学号和项目id查找邀请码
    ViewTeam getTeamByStudentAndProject(Integer studentId, Integer projectId);

    int updateTeamScore(Integer team_id, Double group_marks);
    List<Team> getTeamsByTopicId(Integer topic_id);
}
